#ifndef DIALOG_DATATRANS_H
#define DIALOG_DATATRANS_H
#include <QSqlQuery>
#include <QSqlError>
#include <QDialog>
#include "threadyb.h"
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkInterface>
#include <QNetworkRequest>


namespace Ui {
class Dialog_datatrans;
}

class Dialog_datatrans : public QDialog
{
    Q_OBJECT

public:
    explicit Dialog_datatrans(QWidget *parent = nullptr);
    ~Dialog_datatrans();
public slots:
    void pbExitPressed();
    void pbRunPressed();
    void pbShowFieldsPressed();
    void windClose();

    void handleRet(const int, const QString );  //医保交易

    void getRequestFinished(QNetworkReply *);
    void postRequestFinished(QNetworkReply *);

signals:
    void opThread(int, QString);

private:
    Ui::Dialog_datatrans *ui;
    QSqlQuery *qro;
    QSqlQuery *qrm;

    QString sq;
    QString fieldsName;
    QString fieldsType;
    //QSqlError sqlE;

    QThread thread;
    ThreadYb *ybBusiness;
    volatile bool businessFinish;    //医保交易完成标志
    QString businessRetStr; //医保交易返回
    int businessRetVal; //医保交易返回

   // QNetworkReply * rpl ;
};

#endif // DIALOG_DATATRANS_H
